package org.jeecg.common.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author:wly
 * @Date:2021/9/28
 * @Describtion:
 */
public class GetUrlUtil {
    //获取url
    public static List<Map<String,Object>> getUrl(String billFile,String fileurl){
        List<Map<String,Object>> fileList = new ArrayList<Map<String,Object>>();
        if(!billFile.equals("")){
            if(billFile.contains(",")){
                String[] billFiles = billFile.split(",");
                for (String billFile1 : billFiles) {
                    Map<String,Object> fileMap = new HashMap<String,Object>();
                    fileMap.put("url",billFile1);
                    fileList.add(fileMap);
                }
            }else{
                Map<String,Object> fileMap = new HashMap<String,Object>();
                fileMap.put("url",billFile);
                fileList.add(fileMap);
            }
        }
        return fileList;
    }
}
